<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>人和人律师事务所管理系统v1.0-个人联系方式</title>
	<script type="text/javascript">

		var modifyContactWin;
		Ext.onReady(function()
		{

		var contactFormPanel=new Ext.FormPanel(
				{
					labelAlign:'right',
					buttonAlign:'center',
					frame:true,
					width:300,
					height:100,
			        labelWidth:100,
			        layout: 'form',

			        items:
			        [

			        {
			        	xtype : 'hidden',
			          name: 'userId',
			          value:<%=session.getAttribute("userId")%>,
			         },
			         {
			        	xtype : 'hidden',
			          name: 'role',
			          value:<%=session.getAttribute("role")%>,
			         },
					{
			         height:15,
			          name: 'plan',
			         },
			        {
			        	  xtype : 'textfield',
				          fieldLabel: '新的联系方式',
				          name: 'new_contact',
				          id:'new_contact'
			         }
			        ],
			         buttons : [ {
			            text : '确认',
			            iconCls:'confirm',
			            disabled : false,
			            handler : function() {
			            //判断输入是否为NULL
			             var conctract=Ext.getCmp("new_contact").getValue();
			             if(conctract==""){
			              Ext.MessageBox.alert('提示', '请输入新的联系方式');
			              return;
			             }
			                if (contactFormPanel.form.isValid()) {
			                    contactFormPanel.form.submit( {
			                        url : 'ModifyPersonalContact.jsj',
			                        success : function(from, action) {
			                         Ext.MessageBox.alert('修改结果', action.result.message);
			                            modifyContactWin.hide();
			                        },
			                        failure : function(form, action) {
			                           Ext.MessageBox.alert('修改结果', action.result.message);
			                            modifyContactWin.hide();
			                        },
			                        waitMsg : '正在保存数据，稍后...'
			                    });
			                   // dialog.hide();
			                } else {
			                    Ext.Msg.alert('信息', '请填写完成再提交!');
			                }
			            }
			        }, {
			            text : '取消',
			            iconCls:'cancel',
			            handler : function() {
			                modifyContactWin.hide();
			            }
			        }]
			        });
						modifyContactWin=new Ext.Window(
						{
							title:"修改联系方式",
							resizable:false,
							items:contactFormPanel
						});

						modifyContactWin.show();
					});

	</script>
	</head>
	<body>

	</body>
</html>